import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'
Vue.use(Vuex)

const confing = {
    //定义状态
    plugins: [createPersistedState()],
    state: {
        isName: "李白",
        username: "请登录",
        isLogin: false
    },
    //getters
    getters: {

    },
    //mutations
    mutations: {
        isLogin(state, payload) {
            state.isLogin = payload;
        },
        username(state, payload) {
            state.username = payload;
        }
    },
    //axtion
    actions: {

    },
    modules: {

    }
}
export default new Vuex.Store(confing);